package com.youpingou.controller;

import com.youpingou.config.Websocket;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/news")
public class NewsController {
 
    @GetMapping("/send/{sn}")
    public String send(@PathVariable("sn")String sn){
        Websocket.sendMessage(sn,"1");
        return "发送消息成功";
    }
 
}